<!-- container -->
  <div class="container container-gary top-red">
      <!-- page banner -->
      <div class="product-detail wrap1">
          <div class="product-intro">
              <div class="intro-head">
                  <div class="intro-notice sign-in-width clearfix">
                      <i class="intro-icon"></i>
                      <div class="picScroll-top">
                          <div class="bd">
                              <ul class="picList">
                                  <li><a href="">服务须知：我们的审核时限为24小时(工作日)，遇法定节假日顺延。如有疑问，请拨打企业专享热线：<span class="red">400-078-5858 或留言咨询</span></a></li>
                                  <li><a href="">若商品库存缺货，请联系电话或QQ：<span class="red">4000785858 </span>咨询</a></li>
                                  <li><a href="">若商品库存缺货，请联系电话或QQ：<span class="red">4000785858 </span>咨询</a></li>
                              </ul>
                          </div>
                          <div class="hd">
                              <a class="next"></a><ul></ul><a class="prev"></a><span class="pageState"></span>
                          </div>
                      </div>
                  </div>
                  <div class="sign-in-welcome">
                      <h3>欢迎注册成为企业用户</h3>
                      <ul class="clearfix">
                          <li>
                              <div><img src="/public/uploads/timages/welcome-icon1.png" /></div>
                              <div class="sign-w-tite">价格保护</div>
                              <div>只服务中间商客户 <br />保证价格空间</div>
                          </li>
                          <li>
                              <div><img src="/public/uploads/timages/welcome-icon2.png" /></div>
                              <div class="sign-w-tite">24小时发货</div>
                              <div>全国范围内多仓配发 <br />24小时极速发货</div>
                          </li>
                          <li>
                              <div><img src="/public/uploads/timages/welcome-icon3.png" /></div>
                              <div class="sign-w-tite">合同增票</div>
                              <div>自营商品开具增值税发票 <br />保障企业权益</div>
                          </li>
                          <li>
                              <div><img src="/public/uploads/timages/welcome-icon4.png" /></div>
                              <div class="sign-w-tite">VIP通道</div>
                              <div>VIP客服贴心服务 <br />专属热线</div>
                          </li>
                          <li>
                              <div><img src="/public/uploads/timages/welcome-icon5.png" /></div>
                              <div class="sign-w-tite">定制服务</div>
                              <div>更多选择更多组合 <br />一站式设计解决方案</div>
                          </li>
                          <li>
                              <div><img src="/public/uploads/timages/welcome-icon6.png" /></div>
                              <div class="sign-w-tite">先行赔付</div>
                              <div>售后问题先行赔付 <br />售后无忧</div>
                          </li>
                      </ul>
                  </div>
                  <form id="myform" action="{:url('member/login/doreg')}">
                    <div class="sign-in-tit"><b>账户信息</b></div>
                    <div class="sign-in-content">
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_user_name']" value="1"}<span class="red">*</span>{/eq} 用户名：</div>
                            <input class="enter-inputer" type="text" placeholder="请输入用户名" name="user_name" id="user_name"/>
                            <div class="enter-prompt" id="name_member">4-20位字符，支持汉字、字母、数字组合</div>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text"><span class="red">*</span> 请设置密码：</div>
                            <input class="enter-inputer" type="password" placeholder="请输入注册密码" name="password" id="password"/>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text"><span class="red">*</span> 请确认密码：</div>
                            <input class="enter-inputer" type="password" placeholder="请再次输入注册密码" id="pwdconfirm"/>
                        </div>
                    </div>

                    <div class="sign-in-tit"><b>公司信息</b></div>
                    <div class="sign-in-content">
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_company']" value="1"}<span class="red">*</span>{/eq} 公司名称：</div>
                            <input class="enter-inputer" type="text" placeholder="请输入您所在的公司名称" name="company" id="company"/>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_province']" value="1"}<span class="red">*</span>{/eq} 公司所在地：</div>
                            <select class="enter-select" id="province" name="province" onchange="region.changed(this, 2, 'city')">
                                <option value="">请选择</option>
                                {foreach name="province" item="vo"}
                                <option value="{$vo.id}">{$vo.name}</option>
                                {/foreach}
                            </select>
                            <select class="enter-select" id="city" name="city" onchange="region.changed(this, 3, 'town')"><option value="">请选择</option></select>
                            <select class="enter-select" id="town" name="town"><option value="">请选择</option></select>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_addr']" value="1"}<span class="red">*</span>{/eq} 公司地址：</div>
                            <input class="enter-inputer" type="text" placeholder="请输入您公司的具体地址" name="addr" id="addr"/>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_is_depot']" value="1"}<span class="red">*</span>{/eq}有无仓库：</div>
                            <div class="demo-list">
                                <ul class="clearfix">
                                    <li>
                                        <input tabindex="3" type="radio" id="input-3" name="is_depot">
                                        <label for="input-3">有</label>
                                    </li>
                                    <li>
                                        <input tabindex="4" type="radio" id="input-4" name="is_depot" checked>
                                        <label for="input-4">无</label>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_industry']" value="1"}<span class="red">*</span>{/eq}公司行业：</div>
                            <select class="enter-select enter-w1" name="industry" id="industry">
                                <option value="">请选择</option>
                                {foreach name="industry" item="vo"}
                                <option value="{$vo.id}">{$vo.name}</option>
                                {/foreach}
                            </select>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_company_nature']" value="1"}<span class="red">*</span>{/eq}公司性质：</div>
                            <select class="enter-select enter-w1" name="company_nature" id="company_nature">
                                <option value="">请选择</option>
                                {foreach name="company_nature" item="vo"}
                                <option value="{$vo.id}">{$vo.company_nature}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>

                    <div class="sign-in-tit"><b>联系人信息</b></div>
                    <div class="sign-in-content">
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_name']" value="1"}<span class="red">*</span>{/eq} 联系人姓名：</div>
                            <input class="enter-inputer" type="text" placeholder="请输入联系人姓名" name="name" id="name"/>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_department']" value="1"}<span class="red">*</span>{/eq} 所在部门：</div>
                            <select class="enter-select enter-w1" name="department" id="department">
                                <option value="">请选择</option>
                                {foreach name="department" item="vo"}
                                <option value="{$vo.department_id}">{$vo.department}</option>
                                {/foreach}
                            </select>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_tel']" value="1"}<span class="red">*</span>{/eq} 固定电话：</div>
                            <input class="enter-inputer" type="text" placeholder="请输入您公司的固定电话" name="tel" id="tel"/>
                        </div>
                        <input type="hidden" name="checkverify" id="checkverify" value="{$check_verify}" />
                        {eq name="$check_verify" value="1"}
                            <div class="sign-in-enter clearfix">
                                <div class="sign-in-text"><span class="red">*</span> 验证码：</div>
                                <input class="enter-inputer enter-i-w1" type="text" placeholder="请输入验证码" name="verify" id="verify"/>
                                <div class="enter-sign"><img src="{:captcha_src()}" alt="captcha" style="height: 34px" title="点击刷新" id="codeimg" class="reloadverify verifyimg"/></div>
                                <div class="enter-prompt">看不清？ <a class="red reloadverify" href="javascript:void(0);" >换一张</a></div>
                            </div>
                        {/eq}
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_mobile']" value="1"}<span class="red">*</span>{/eq} 验证手机：</div>
                            <input class="enter-inputer" type="text" placeholder="请输入您要验证的手机号" name="mobile" id="mobile"/>
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text"><span class="red">*</span> 短信验证码：</div>
                            <input class="enter-inputer enter-i-w1" type="text" placeholder="请输入短信验证码" name="telverify" id="telverify"/>
                            <input class="enter-btn" type="button" id="btnSendCode" onclick="sendMessage()" value="获取短信验证码" />
                        </div>
                        <div class="sign-in-enter clearfix">
                            <div class="sign-in-text">{eq name="regoption['reg_email']" value="1"}<span class="red">*</span>{/eq} 联系人邮箱：</div>
                            <input class="enter-inputer" type="text" placeholder="请输入联系人邮箱" name="email" id="email"/>
                        </div>
                        <div class="sign-in-enter sign-in-ml clearfix">
                            <input tabindex="1" type="checkbox" id="agree" checked="checked">
                            <label for="agree">我已阅读并同意<span class="red">《 喜宝用户注册协议 》《 隐私政策 》</span></label>
                        </div>
                        <div class="sign-in-enter"><input class="enter-btn1" type="button" value="立即注册" id="save"/></div>
                    </div>
                  </form>
              </div>
          </div>
      </div>
  </div>

  <!-- footer -->
  <!--#include file="includes/foot.html"-->
 <!-- check -->
<script src="/public/static/home/js/icheck.js"></script>
<script src="/public/static/home/js/region.js?r=1"></script>
<script src="/public/static/home/js/sendverify.js"></script>
 <!-- notice -->
 <script type="text/javascript" src="/public/static/home/js/jquery.SuperSlide.2.1.1.js"></script>
 <script>
    //intro notice
    jQuery(".picScroll-top").slide({
        titCell: ".hd ul",
        mainCell: ".bd ul",
        autoPage: true,
        effect: "top",
        autoPlay: true,
        vis: 1,
        trigger: "click"
    });
    //input
    $(document).ready(function () {
        var callbacks_list = $('.demo-callbacks ul');
        $('.demo-list input,.sign-in-enter input').on('ifCreated ifClicked ifChanged ifChecked ifUnchecked ifDisabled ifEnabled ifDestroyed', function (event) {
            callbacks_list.prepend('<li><span>#' + this.id + '</span> is ' + event.type.replace('if', '').toLowerCase() + '</li>');
        }).iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%'
        });
    });

    $(function(){
        $("#save").click(function(){
            var user_name = $('#user_name');
            var password = $('#password');
            var pwdconfirm = $('#pwdconfirm');
            var company = $('#company');
            var province = $('#province option:selected');
            var city = $('#city option:selected');
            var town = $('#town option:selected');
            var addr = $('#addr');
            var is_depot = $('#is_depot');
            var industry = $('#industry option:selected');
            var company_nature = $('#company_nature option:selected');
            var name = $('#name');
            var department = $('#department option:selected');
            var tel = $('#tel');
            var mobile = $('#mobile');
            var telverify = $('#telverify');
            var email = $('#email');
            var checkverify=$('#checkverify');
            var verify = $('#verify');
            if ($("#agree").prop("checked")) {
                if(user_name.val()=='' && "{$regoption['reg_user_name']}"=="1"){
                    alert("请输入用户名");
                    user_name.focus();
                    return false;
                }else if (password.val()=='') {
                    alert("请输入密码");
                    password.focus();
                    return false;
                } else if (pwdconfirm.val()=='') {
                    alert("请再次输入密码");
                    pwdconfirm.focus();
                    return false;
                } else if (password.val() != pwdconfirm.val()) {
                    alert("两次输入密码不一致");
                    pwdconfirm.focus();
                    return false;
                } else if (company.val()=='' && "{$regoption['reg_company']}"=="1") {
                    alert("请输入公司名称");
                    company.focus();
                    return false;
                } else if (province.val()=='' && "{$regoption['reg_province']}"=="1") {
                    alert("请选择省份");
                    province.focus();
                    return false;
                } else if (city == '' && "{$regoption['reg_city']}"=="1") {
                    alert("请选择城市");
                    city.focus();
                    return false;
                } else if (town == '' && "{$regoption['reg_town']}"=="1") {
                    alert("请选择城市");
                    town.focus();
                    return false;
                } else if (addr.val()=='' && "{$regoption['reg_addr']}"=="1") {
                    alert("请输入公司地址");
                    addr.focus();
                    return false;
                } else if (is_depot.prop('checked') && "{$regoption['reg_is_depot']}"=="1") {
                    alert("请选择有无仓库");
                    is_depot.focus();
                    return false;
                } else if (industry.val()=='' && "{$regoption['reg_industry']}"=="1") {
                    alert("请选择公司行业");
                    industry.focus();
                    return false;
                } else if (company_nature.val()=='' && "{$regoption['reg_company_nature']}"=="1") {
                    alert("请选择公司性质");
                    company_nature.focus();
                    return false;
                } else if (name.val()=='' && "{$regoption['reg_name']}"=="1") {
                    alert("请输入联系人");
                    name.focus();
                    return false;
                } else if (department.val()=='' && "{$regoption['reg_department']}"=="1") {
                    alert("请选择所在部门");
                    department.focus();
                    return false;
                } else if (tel.val()=='' && "{$regoption['reg_tel']}"=="1") {
                    alert("请输入固话");
                    tel.focus();
                    return false;
                } else if (mobile.val()=='' && "{$regoption['reg_mobile']}"=="1") {
                    alert("请输入手机号码");
                    mobile.focus();
                    return false;
                } else if(verify==''&&checkverify.val()=='1'){
                    alert("请输入验证码");
                    $("#verify").focus();
                    return false;
                }else if (telverify == '') {
                    alert("请输入短信验证码");
                    telverify.focus();
                    return false;
                } else if (email.val()=='' && "{$regoption['reg_email']}"=="1") {
                    alert("请输入邮箱");
                    email.focus();
                    return false;
                } else {
                    $.ajax({
                        url:"{:url('member/login/doreg')}",
                        type:'post',
                        data:$("#myform").serialize(),
                        success:function (data) {
                            if(data.code==200){
                                window.location.href="{:url('member/member/index')}";
                            }else{
                                if(checkverify.val()=='1'){
                                    var verifyimg = $(".verifyimg").attr("src");
                                    if (verifyimg.indexOf('?') > 0) {
                                        $(".verifyimg").attr("src", verifyimg + '&random=' + Math.random());
                                    } else {
                                        $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/, '') + '?' + Math.random());
                                    }
                                    $("#verify").focus();
                                }
                                alert(data.msg);
                            }
                        },
                        error: function(err, data) {
                            console.log(err); 
                        }
                    });
                }
            }else{
                alert("请先同意《 喜宝用户注册协议 》《 隐私政策 》");
                return false;
            }
        })
    })   
    function sendMessage() {
        var mobile = $("#mobile").val();
        if (mobile == '') {
            alert("手机号码不能为空");
            $("#mobile").focus();
            return false;
        } else {
            if (!/^1[3|4|5|7|8][0-9]{9}$/.test(mobile)) {
                alert("手机号码格式不正确");
                $("#mobile").focus();
                return false;
            } else {
                SendVerify.sendMessage($("#btnSendCode"),mobile,'phone','sms_reg_tpl');
            }
        }
    }
 </script>

</body>
</html>